package com.travelms.util;

import java.util.regex.Pattern;

public class DataEffect {


    //用户输入判断，只能是数字
        public static boolean isNumber(String s){
            //用户输入判断，只能是数子
            int aim;

                try {
                    aim = Integer.parseInt(s);
                    if(aim < 0 || aim > 1000000000) {
                        System.out.println("---输入错误!!!---");
                        return false;
                    }

                    return true;
                } catch (NumberFormatException e) {
                    System.out.println("---输入错误!!!---");
                    return false;
                }

        }
        //账号密码长度核实
    public static boolean checkUserRule(String user){
        String regex = "^[a-zA-Z0-9]{6,11}$";
        return Pattern.matches(regex,user);
        }
        public static boolean checkPasswordRule(String password){
            String regex = ".{6,11}";
            return Pattern.matches(regex,password);
    }



}
